<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>
	<body>
		<script>
			function fabonaicc(n) {
				if (n === 1 || n === 2) {
					return 1
				}

				return fabonaicc(n - 1) + fabonaicc(n - 2)
			}

			function fabonaicc2(n) {
				var n1 = 1
				var n2 = 1
				var resule = 0

				if (n === 1 || n === 2) return 1

				for (var i = 2; i < n; i++) {
					resule = n1 + n2
					n1 = n2
					n2 = resule
				}
				return resule
			}

			console.log('fabonaicc(8):', fabonaicc(8))
			console.log('fabonaicc2(8):', fabonaicc2(8))
		</script>
	</body>
</html>
